package cn.edu.nwsuaf.teachercenter.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * ExamItemType entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "exam_item_type", catalog = "exam")
public class ExamItemType implements java.io.Serializable {

	// Fields

	private String examItemTypeNo;
	private String examItemTypeName;
	private String examItemTypeDescription;
	private Set<ExamItem> examItems = new HashSet<ExamItem>(0);
	private Set<ExerciceItem> exerciceItems = new HashSet<ExerciceItem>(0);

	// Constructors

	/** default constructor */
	public ExamItemType() {
	}

	/** minimal constructor */
	public ExamItemType(String examItemTypeNo, String examItemTypeName,
			String examItemTypeDescription) {
		this.examItemTypeNo = examItemTypeNo;
		this.examItemTypeName = examItemTypeName;
		this.examItemTypeDescription = examItemTypeDescription;
	}

	/** full constructor */
	public ExamItemType(String examItemTypeNo, String examItemTypeName,
			String examItemTypeDescription, Set<ExamItem> examItems,
			Set<ExerciceItem> exerciceItems) {
		this.examItemTypeNo = examItemTypeNo;
		this.examItemTypeName = examItemTypeName;
		this.examItemTypeDescription = examItemTypeDescription;
		this.examItems = examItems;
		this.exerciceItems = exerciceItems;
	}

	// Property accessors
	@Id
	@Column(name = "exam_item_type_no", unique = true, nullable = false, length = 50)
	public String getExamItemTypeNo() {
		return this.examItemTypeNo;
	}

	public void setExamItemTypeNo(String examItemTypeNo) {
		this.examItemTypeNo = examItemTypeNo;
	}

	@Column(name = "exam_item_type_name", nullable = false, length = 50)
	public String getExamItemTypeName() {
		return this.examItemTypeName;
	}

	public void setExamItemTypeName(String examItemTypeName) {
		this.examItemTypeName = examItemTypeName;
	}

	@Column(name = "exam_item_type_description", nullable = false, length = 100)
	public String getExamItemTypeDescription() {
		return this.examItemTypeDescription;
	}

	public void setExamItemTypeDescription(String examItemTypeDescription) {
		this.examItemTypeDescription = examItemTypeDescription;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "examItemType")
	public Set<ExamItem> getExamItems() {
		return this.examItems;
	}

	public void setExamItems(Set<ExamItem> examItems) {
		this.examItems = examItems;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "examItemType")
	public Set<ExerciceItem> getExerciceItems() {
		return this.exerciceItems;
	}

	public void setExerciceItems(Set<ExerciceItem> exerciceItems) {
		this.exerciceItems = exerciceItems;
	}

}